package com.fly.mapper;

import com.fly.domain.Menu;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author Fly
 * @Description
 * @Date Created in 16:47 2018/1/31
 * @Modified by
 */
@Component
@Mapper
public interface MenuMapper {

    /**
     * 根据父ID查找菜单
     * @param parentId
     * @return
     */
    List<Menu> getMenusByParentId(Long parentId);
    /**
     * 查询用户所授权的菜单
     * @param userId
     * @return
     */
    List<Menu> getMenusByUserId(Long userId);

    /**
     * 根据角色id查找
     * @param roleId
     * @return
     */
    List<Long> getMenuIdsByRoleId(Long roleId);
}
